import request from '../utils/request.js'

// 首页
export const getIndex = () => {
  return request.get( '/getminiindex')
}

// 获取banner
export const getBanner = (name) => {
  return request.get( '/banner/' + name
  )
}

// 获取验证码 手机号 params
export const getcode = (data) => {
  return request.post('/ucenter/loginsendphone?phone='+data)
}


// 获取验证码（除登录外手机验证码都走这个）手机号 params
export const getcodeNew = (data) => {
  return request.post('/phone/send',data,{jsonType:2})
}


// 登录 params
export const login = (data) => {
  return request.post('/ucenter/loginbyphone?phone='+data.phone+'&code='+data.code)
}

// 微信登录
export const wxlogin = (data) => {
  return request.post('/ucenter/loginbymini?code='+data.code)
}

// 绑定手机号
export const bindphone = (data) => {
  return request.post('/ucenter/bindphone?phone='+data.phone+'&openid='+data.openid+'&code='+data.code)
}

// 解密手机号
export const decrypt = (data) => {
  return request.post('/wechat/decrypt',data)
}

// 发布留言
export const sendMessage = (data) => {
  return request.post( '/message/add',
    data)
}

// 发布加盟信息
export const joinAdd = (data) => {
  return request.post( '/join/add',
    data)
}

// 获取图形验证码
export const captchaImage = () => {
  return request.get( '/captchaImage')
}

// 单页调用
export const getPage = (id) => {
  return request.get(
    '/page/' + id)
}

// 获取招聘搜索条件
export const getjobdata = (id) => {
  return request.get('/getjobdata')
}

// 上传图片
export const uploadImg = (data) => {
  return request.post('/common/upload',data)
}


// 退出登录
export const loginout = (data) => {
  return request.post('/user/loginout',data)
}
